﻿@model IEnumerable<INTREPWEB.Models.Navio>
@{
    ViewBag.Title = "Navios";


    if (IsAjax)
    {
        Layout = null;
    <script type="text/javascript" src="@Url.Content("~/Scripts/intrep-navio.js")" ></script>
    }  
}
@Html.Partial("_ToolBar")
@if (ViewBag.Vazio == null)
{
    <table>
        <tr>
            <th>
            </th>
            <th>
                Nome
            </th>
            <th>
                Porões
            </th>
            <th>
                Armador
            </th>
            <th>
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    <input type="checkbox" id="selectcheck" />
                </td>
                <td>
                    @Ajax.ActionLink(item.Nome, "Editar", new { id = item.Id }, new AjaxOptions { OnBegin = "criaModal('editarnavio')", UpdateTargetId = "editarnavio", OnSuccess = "$.modalPopup('editarnavio')" })
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Poroes)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Armador.Nome)
                </td>
                <td>
                    @Ajax.ActionLink("x", "Deletar", new { id = item.Id }, new AjaxOptions { OnBegin = "criaModal('deletarnavio')", UpdateTargetId = "deletarnavio", OnSuccess = "$.modalPopup('deletarnavio')" })
                </td>
            </tr>
        }
    </table>


    
}
else
{
    @Html.Partial("_SemItens")
}